package com.springioc;

import com.springioc.config.UserConfig;
import com.springioc.controller.UserController;
import com.springioc.model.UserInfo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan("com.springioc")
@SpringBootApplication
public class SpringIocApplication {

	public static void main(String[] args) {
		ApplicationContext context = SpringApplication.run(SpringIocApplication.class, args);
		UserController userController = context.getBean(UserController.class);
		userController.sayHi();
//		UserService bean2 = context.getBean(UserService.class);
//		System.out.println(bean2);
//		bean2.HiSay();
//		UserReposittory userReposittory = context.getBean(UserReposittory.class);
//		userReposittory.HiSay();
//		UserComponent userComponent = context.getBean(UserComponent.class);
//		userComponent.SayHi();
//		UserConfig userConfig = context.getBean(UserConfig.class);
//		userConfig.SayHi();
//		UserInfo bean = context.getBean("2",UserInfo.class);
//		System.out.println(bean);

//		UserConfig userConfig = (UserConfig) context.getBean("config");
//		userConfig.SayHi();
	}


}
